package cn.virens.common.mybatis.datasource;

public class DataSourceUtils extends InheritableThreadLocal<DataSourceType> {
    private static final DataSourceUtils CONTEXT_HOLDER = new DataSourceUtils();

    /**
     * 设置当前指向的实例类型
     *
     * @param dbType 实例类型
     */
    public static void set0(DataSourceType dbType) {
        CONTEXT_HOLDER.set(dbType);
    }

    /**
     * 获取当前指向的实例类型
     *
     * @return 实例类型
     */
    public static DataSourceType get0() {
        return CONTEXT_HOLDER.get();
    }
}
